import http from '@/utils'

class Advert {
    // 获取列表  必传module 为module接口里的code
    getList(reload) {
        let url = '/ad/index';
        return http.get(url, reload)
    }

    // 新增
    createContent(reload) {
        let url = '/ad/create';
        return http.post(url, reload)
    }

    // 编辑
    editContent(reload) {
        let url = '/ad/edit';
        return http.post(url, reload)
    }

    // 详情 detail 参数 id
    getContentDetail(reload) {
        let url = '/ad/detail';
        return http.get(url, reload)
    }

    // 删除
    deleteContent(reload) {
        let url = '/ad/delete';
        return http.post(url, reload)
    }

    // 更新唯一字段
    updateOnlyfield(reload) {
        let url = '/ad/onlyfield';
        return http.post(url, reload)
    }

    // 所有广告位列表 ad_position 用于选择下拉
    getAdPosition(reload) {
        let url = '/ad/ad_position';
        return http.get(url, reload)
    }
}

export default new Advert()